<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Seminário PIBIC 2014</title>
    </h:head>
    <h:body>
        <p:panel id="panel"
                 header="Formulario de Cadastro">
            <h:form id="formCadastrar">
                <h:panelGrid columns="3">
                    <span>Nome: </span>
                    <p:inputText id="txNome"
                                 value="#{usuarioBean.usuario.nome}"
                                 label="Nome"
                                 required="true"/>
                    <p:message for="txNome"/>

                    <span>Login: </span>
                    <p:inputText id="txLogin"
                                 value="#{usuarioBean.usuario.login}"
                                 label="Login"
                                 required="true"/>
                    <p:message for="txLogin"/>

                    <span>Senha: </span>
                    <p:password id="txSenha"
                                value="#{usuarioBean.usuario.senha}"
                                validatorMessage="Erro na confirmação da senha"
                                label="Senha"
                                match="txSenhaConfir"
                                required="true"/>    
                    <p:message for="txSenha"/>

                    <span>Confirmar Senha: </span>
                    <p:password id="txSenhaConfir"
                                label="Senha"
                                required="true"/>
                </h:panelGrid>

                <p>
                    <p:commandButton id="cbSalvar"
                                     ajax="false"
                                     value="Salvar"
                                     action="#{usuarioBean.cadastrar()}"/>
                    <p:button id="cbVoltar"
                              value="Voltar"
                              outcome="login"/>
                </p>
            </h:form>
        </p:panel>
    </h:body>
</html>

